﻿package org.net.DMsg
{
	import flash.utils.IDataInput;
	import flash.utils.getDefinitionByName;
	
	public class DMsg
	{
		public static const  PACKET_NAME:String = "com.gowin.Net.DMsg";
		public var id:int = 0;
				
		public function DMsg()
		{
		}
		
		public function read(dis:IDataInput):void
		{
		}
		
		public static function parse(dis:IDataInput,type:int):DMsg
		{			
			var classNmae:String = PACKET_NAME+".DMsg"+type;
			trace(classNmae);
			var classRefrence:Class = getDefinitionByName(classNmae) as Class;
			var instance:DMsg = new classRefrence() as DMsg;
			instance.read(dis);
			return instance;
			
		}
	}
}